
package com.iocup.keybastion.annotion;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * @Description: 根据条件判断是否具有角色或者权限码
 * @Author: xyjxust
 * @Date: 2022/3/22 11:03
 */
@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
public @interface HasAuthorization {


    String ROLE = "role";
    String PERMISSION = "permission";
    String LOGICAL = "logical";

    /**
     * 角色
     * @return
     */
    HasRole role();

    /**
     * 权限码
     * @return
     */
    HasPermission permission();

    Logical logical() default Logical.ANY;
}
